<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="用料记录" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<script language="javascript">
	function showMe(){
		if(parent.document.getElementById("detailFrm")!=null){
			parent.document.getElementById("detailFrm").style.height=document.body.scrollHeight+"px";
		}
	}
</script>
</head>
<body style="margin:0px;padding:0px;" oncontextmenu="return false" onLoad="showMe();"   class="sheet">
<div class="sheet-main" style="width:980px">
	  <div class="sheet-list">
			  <div class="table-list" >
			   <fieldset class="det_fieldset "> <legend class="mag10">用料记录</legend>  	
			     <table width="100%" align="center">      
							<tr>
								<th width="15%">单号</th>
								<th width="9%">日期</th>
								<th width="15%">供/需方</th>
								<th width="6%">出/入</th>
								<th width="14%">材料编号</th>
								<th width="20%">品名规格</th>
								<c:if test="${showCost=='1'}">
									<th width="7%">单位</th>
									<th width="7%">数量</th>
									<th width="7%">金额</th>
								</c:if>
								<c:if test="${showCost!='1'}">
									<th width="10%">单位</th>
									<th width="11%">数量</th>
								</c:if>
							</tr>
							<c:forEach var="item" items="${list}">
							<tr>
								<td>${item.billCode}</td>
								<td><fmt:formatDate value="${item.billDate}" pattern="yyyy-MM-dd"/></td>
								<td>${item.otherName}</td>
								<td>
									<c:if test="${item.billType=='IN'}">入</c:if>
						    		<c:if test="${item.billType=='OUT'}">出</c:if>
								</td>
								<td>${item.productCode}</td>
								<td>${item.productName}</td>
								<td>${item.productUnit}</td>
								<td>
									<c:if test="${item.billType=='IN'}"><commonTag:parseBigDecimal source="${item.inAmount}" /></c:if>
						    		<c:if test="${item.billType=='OUT'}"><commonTag:parseBigDecimal source="${item.outAmount}" /></c:if>
								</td>
								<c:if test="${showCost=='1'}">
									<td>
										<c:if test="${item.billType=='IN'}">${0-item.inCost}</c:if>
										<c:if test="${item.billType=='OUT'}">${item.outCost}</c:if>
									</td>
								</c:if>
							</tr>
							</c:forEach>
				   </table>
			   </fieldset>
			  </div>
			</div>
</div>
</body>
</html>